<?php

declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class WechatTransferBillPackageInfo extends AbstractMigration
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change(): void
    {
        $table = $this->table('wechatpay_transfer_bill');
        $table->addColumn('transfer_scene_id', 'string', ['limit' => 64, 'comment' => '转账场景ID', 'after' => 'user_name'])
            ->addColumn('user_recv_perception', 'string', ['limit' => 255, 'comment' => '用户收款感知', 'after' => 'transfer_scene_id'])
            ->addColumn('accept_time', 'timestamp', ['comment' => '受理时间', 'after' => 'user_recv_perception'])
            ->addColumn('transfer_scene_report_infos', 'json', ['comment' => '转账场景ID', 'after' => 'accept_time'])
            ->addColumn('package_info', 'json', ['comment' => '跳转领取页面的package信息', 'after' => 'transfer_scene_report_infos'])
            ->update();
    }
}
